package domain;

import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

@Entity
@Access(AccessType.PROPERTY)
public class Requirement extends DomainEntity {

	// Constructors

	public Requirement() {
		super();
	}

	// Atributes
	
	private int numberOfExperts;

	
	@Min(1)
	public int getNumberOfExperts() {
		return numberOfExperts;
	}

	public void setNumberOfExperts(int numberOfExperts) {
		this.numberOfExperts = numberOfExperts;
	}

	// Relationships
	
	private Project project;
	private Team group;

	@NotNull
	@Valid
	@ManyToOne(optional = false)
	public Project getProject() {
		return project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	@NotNull
	@Valid
	@ManyToOne(optional = false)
	public Team getGroup() {
		return group;
	}

	public void setGroup(Team group) {
		this.group = group;
	}
	
}